1. Field of the Invention
The present invention relates to a method for determining the square root of a number using a processor, more particularly, to a method using a short-bit processor, such as an 8-bit processor, to determine the square root of a long-bit number, such as a 16-bit or 32-bit number.
2. Description of Related Art
In applications using an 8-bit microprocessor, such as Intel 8051, it is very common to execute an operation to determine the square root of a number. Typically, the square root of a number is obtained by using a Euclid's algorithm or a bisection method. However, the use of the Euclid's algorithm is time-consuming because multiple data shifting operations are required. As to the bisection method, due to the fact that the data width of the processor is short-bited, as 8-bit, this short-bit data has to be rearranged to long-bited, as 16-bit, data for being processed, and thus the operation is also time-consuming. Particularly, in some real-time applications, such as CD/DVD jump track calculation, the system performance is likely to be degraded significantly in using these conventional methods.
In order to solve the aforementioned problem, a lookup table and its due interpolation method can be employed. The use of such a lookup table is direct and requires no heavy operation step, and the result obtained by using the lookup table is acceptable. However, the use of lookup table encounters a problem occupying a large memory space. Particularly, in the CD/DVD drive tracking application, there need three lookup tables for the general CD, single layer DVD and double layer DVD, and thus the memory space required is considerable. Accordingly, there is a desire to have a novel method to mitigate and/or obviate the aforementioned problems.